package com.gitee.elead.mybatisplus;

import static java.util.stream.Collectors.toList;

import java.util.List;
import java.util.stream.Stream;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.AbstractSqlInjector;
import com.baomidou.mybatisplus.core.injector.methods.Delete;
import com.baomidou.mybatisplus.core.injector.methods.DeleteBatchByIds;
import com.baomidou.mybatisplus.core.injector.methods.DeleteById;
import com.baomidou.mybatisplus.core.injector.methods.DeleteByMap;
import com.baomidou.mybatisplus.core.injector.methods.Insert;
import com.baomidou.mybatisplus.core.injector.methods.SelectBatchByIds;
import com.baomidou.mybatisplus.core.injector.methods.SelectById;
import com.baomidou.mybatisplus.core.injector.methods.SelectByMap;
import com.baomidou.mybatisplus.core.injector.methods.SelectCount;
import com.baomidou.mybatisplus.core.injector.methods.SelectList;
import com.baomidou.mybatisplus.core.injector.methods.SelectMaps;
import com.baomidou.mybatisplus.core.injector.methods.SelectMapsPage;
import com.baomidou.mybatisplus.core.injector.methods.SelectObjs;
import com.baomidou.mybatisplus.core.injector.methods.SelectOne;
import com.baomidou.mybatisplus.core.injector.methods.SelectPage;
import com.baomidou.mybatisplus.core.injector.methods.Update;
import com.baomidou.mybatisplus.core.injector.methods.UpdateById;
import com.baomidou.mybatisplus.extension.injector.methods.additional.InsertBatchSomeColumn;

/**
 * <p>
 * MybatisPlusSql注入器
 * </p>
 *
 * @author luopeng
 */
public class MybatisPlusSqlInjector extends AbstractSqlInjector {


	@Override
	public List<AbstractMethod> getMethodList(Class<?> mapperClass) {
		 return Stream.of(
		            new Insert(),
		            new InsertBatchSomeColumn(t -> true),
		            new Delete(),
		            new DeleteByMap(),
		            new DeleteById(),
		            new DeleteBatchByIds(),
		            new Update(),
		            new UpdateById(),
		            new UpdateAllColumnById(),
		            new SelectById(),
		            new SelectBatchByIds(),
		            new SelectByMap(),
		            new SelectOne(),
		            new SelectCount(),
		            new SelectMaps(),
		            new SelectMapsPage(),
		            new SelectObjs(),
		            new SelectList(),
		            new SelectPage()
		        ).collect(toList());
	}

}
